<!-- 事业部分润配置 -->
<template>
  <div class="app-container">
    <!-- <el-row :gutter="10" class="mb-8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleOpen()"
          >新增</el-button
        >
      </el-col>
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row> -->

    <el-table v-loading="loading" :data="dataList">
      <el-table-column label="事业部名称" align="center" prop="channelName" />
      <el-table-column label="服务项目" align="center" prop="serviceProject">
        <template slot-scope="{ row }">
          <div v-if="row.serviceProject === 0">咨询服务类</div>
          <div v-if="row.serviceProject === 1">商品服务类</div>
        </template>
      </el-table-column>
      <el-table-column label="总平台抽成比例" align="center">
        <template slot-scope="{ row }">{{ row.totalPlatformDraw * 100 }}%</template>
      </el-table-column>
      <el-table-column label="事业部技术服务费" align="center">
        <template slot-scope="{ row }">{{ row.divisionCostDraw * 100 }}%</template>
      </el-table-column>

      <el-table-column label="创建时间" align="center" prop="createTime" />
      <el-table-column label="更新时间" align="center" prop="updateTime" />
      <!-- <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        width="120px"
        fixed="right"
      >
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="handleOpen(scope.row.id)"
            >编辑</el-button
          >
        </template>
      </el-table-column> -->
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { getDivisionConfigList } from "@/api/facilitator";

export default {
  name: 'ShareBenefit',
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        keyword: "",
      },
      // 总条数
      total: 0,
      dataList: [],
    };
  },
  created() {
    this.getList();
  },
  activated() {
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      getDivisionConfigList(this.queryParams)
        .then((response) => {
          this.dataList = response.rows;
          this.total = response.total;
        })
        .finally(() => {
          this.loading = false;
        });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    resetQuery() {
      Object.assign(this.$data.queryParams, this.$options.data().queryParams);
      this.getList();
    },
    handleOpen(id) {},
  },
};
</script>

<style lang="scss" scoped></style>
